home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 10
/
010.d81
/
life expectancy
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
5KB
|
198 lines
1 gosub60000
5 rem **** life expectancy quiz
6 :
10 rem *** copyright 1983
20 rem *** by john orban
21 rem *** translated for the commodore
22 rem *** by donna k. woody
23 :
24 poke53280,3:poke53281,0:print"[158]":poke53272,23:printchr$(8)
25 v$=""
26 :
30 print"[147]"tab(18)"[204][201][198][197]"
40 print""tab(15)"[197][216][208][197][195][212][193][206][195][217]"
50 print""tab(18)"[209][213][201][218]"
60 print"":fori=1to19:print"]";:next
70 fori=20to40:print"[";:next
90 print" [193]n [193]nalysis -- [204]ongevity vs [204]ifestyle"
100 print" [200]ow long will ** you ** live?"
120 print"[208]ress <[211][208][193][195][197] [194][193][210]> to begin program....";
130 geta$:ifa$=""then130
140 goto210
150 geta$:ifa$=""then150
160 ifa$<>"n"anda$<>"[206]"anda$<>"y"anda$<>"[217]"goto150
170 return
180 print"[147] [204][201][198][197] [197][216][208][197][195][212][193][206][195][217]"
190 print""tab(19);a
200 return
210 print"[147]":a=72:gosub180
220 printv$"[193]re you male (m) or female (f)?"
230 getb$:ifb$=""then230
240 ifb$<>"m"andb$<>"[205]"andb$<>"f"andb$<>"[198]"then230
250 ifb$="m"orb$="[205]"thena=a-3:goto270
260 a=a+4
270 gosub180
280 printv$"[196]o you live in a city of over 2 million population (y/n)?"
290 gosub150
300 ifa$="y"ora$="[217]"thena=a-2
310 gosub180
320 printv$"[196]o you live in a town under 10,000 pop- ulation or on a farm (y/n)?"
330 gosub150
340 ifa$="[217]"ora$="y"thena=a+2
350 gosub180
360 printv$"[196]o you work behind a desk (y/n)?"
370 gosub150
380 ifa$="y"ora$="[217]"thena=a-3
390 gosub180
400 printv$"[196]oes your work require regular, heavy physical labor (y/n)?"
410 gosub150
420 ifa$="y"ora$="[217]"thena=a+3
430 gosub180
440 printv$"[196]o you exercise strenuously (tennis,"
445 print"running, swimming, etc.) 5 times a week for at least 1/2 hour (y/n)?"
450 gosub150
460 ifa$="y"ora$="[217]"thena=a+2
470 gosub180
480 printv$"[196]o you live with a spouse or friend (y/n)?"
490 gosub150
500 ifa$="y"ora$="[217]"thena=a+5:goto560
510 print"[145][145][200]ow many years have you lived alone since age 25?"
512 print"(1) 1-10 years (2) 11-20 years (3) 21+ years";
520 getb$:ifb$=""then520
525 ifval(b$)<1orval(b$)>3then520
530 b=val(b$)
540 a=a-b
550 goto560
560 gosub180
570 printv$"[196]o you sleep more than 10 hours each night (y/n)?"
580 gosub150
590 ifa$="y"ora$="[217]"thena=a-4
600 gosub180
610 printv$"[193]re you intense, agressive, easily angered (y/n)?"
620 gosub150
630 ifa$="y"ora$="[217]"thena=a-3
640 gosub180
650 printv$"[193]re you usually easy-going and relaxed (y/n)?"
660 gosub150
670 ifa$="y"ora$="[217]"thena=a+3
680 gosub180
690 printv$"[193]re you h[146]appy or u[146]nhappy (h/u)?"
700 geta$:ifa$=""then700
710 ifa$<>"h"anda$<>"[200]"anda$<>"u"anda$<>"[213]"thengoto700
720 ifa$="h"ora$="[200]"thena=a+1:goto740
730 a=a-2
740 gosub180
750 printv$"[200]ave you had a speeding ticket in the last year (y/n)?"
760 gosub150
770 ifa$="y"ora$="[217]"thena=a-1
780 gosub180
790 printv$"[196]o you earn over $50,000 per year (y/n)?"
800 gosub150
810 ifa$="y"ora$="[217]"thena=a-2
820 gosub180
830 printv$"[193]re you a college graduate (y/n)?"
840 gosub150
850 ifa$="y"ora$="[217]"thena=a+1
860 gosub180
870 printv$"[196]o you have a graduate or professional degree (y/n)?"
880 gosub150
890 ifa$="y"ora$="[217]"thena=a+2
900 gosub180
910 printv$"[193]re you over 65 and still working (y/n)?"
920 gosub150
930 ifa$="y"ora$="[217]"thena=a+3
940 gosub180
950 printv$"[196]id any of your grandparents live to age 85 (y/n)?"
960 gosub150
970 ifa$="y"ora$="[217]"thena=a+2
980 gosub180
990 printv$"[196]id either of your parents die of a"
995 print"stroke or heart attack before age 50 (y/n)?"
1000 gosub150
1010 ifa$="y"ora$="[217]"thena=a-4
1020 gosub180
1030 printv$"[196]oes/did any parent, brother/sister"
1032 print"under 50 have/had cancer, heart condi-"
1034 print"tion or has/had diabetes since child- hood (y/n)?"
1040 gosub150
1050 ifa$="y"ora$="[217]"thena=a-3
1060 gosub180
1070 printleft$(v$,7)"[200]ow many packs of cigarettes per day to do you smoke?"
1080 print"(0) ===> [206]one":print"(1) ==> 1/2 - 1":print"(2) ==> 1 - 2"
1090 print"(3) ==> [205]ore than 2"
1100 getb$:ifb$=""then1100
1102 ifb$<>"0"andb$<>"1"andb$<>"2"andb$<>"3"then1100
1110 b=val(b$)
1120 ifb=0thengoto1150
1130 ifb=3thena=a-8:goto1150
1140 a=a-(b*3)
1150 gosub180
1160 printv$"[196]o you drink the equivalant of a quart bottle of liquor a day (y/n)?"
1170 gosub150
1190 gosub180
1200 printv$"[193]re you overweight (y/n)?"
1210 gosub150
1220 ifa$="n"ora$="[206]"thengoto1300
1230 print"[145][145][145][194]y how much? "
1232 print"(1) ==> 50+ lbs ":print"(2) ==> 30-50 lbs"
1234 :print"(3) ==> 30 lbs or less"
1250 getb$:ifb$=""then1250
1252 ifval(b$)<1orval(b$)>3then1250
1260 b=val(b$)
1270 ifb=1thena=a-8:goto1300
1280 ifb=2thena=a-4:goto1300
1290 a=a-2
1300 gosub180
1310 printv$"[193]re you over 40 and do you have a yearlycheckup (y/n)?"
1320 gosub150
1330 ifa$="[217]"ora$="y"thena=a+2
1340 gosub180
1350 fori=1to1000:next
1360 print"[147]"
1370 printtab(15)"[193]ge [193]djustment"
1380 printtab(7)"[201]f you are:"tab(30)"[208]ress:"
1390 print" [194]etween 30 and 40"tab(32)"1"
1400 print" [194]etween 40 and 50"tab(32)"2"
1410 print" [194]etween 50 and 70"tab(32)"3"
1420 print" [207]ver 70"tab(32)"4"
1430 print" [206]one of the above"tab(32)"5"
1440 getb$:ifb$=""then1440
1442 ifval(b$)<1orval(b$)>5then1440
1450 b=val(b$)
1460 ifb<>5thena=a+b+1
1470 gosub180
1480 print""
1490 print" [217]our life expectancy is ";a"[146]"
1510 print"[200]ow well have you done? [212]he following"
1520 print"chart tells what percent of the pop-"
1522 print"ulation you will outlive if you make it"
1524 print"to your life expectancy."
1530 print"[193]ge 60 65 70 75 80 85 90 95"
1540 print"[205]en 26% 36% 48% 61% 75% 87% 96% 99%"
1550 print"[215]omen 15% 20% 30% 39% 53% 70% 88% 97%"
1555 print" [208]ress <[211][208][193][195][197] [194][193][210]> to continue";
1557 getk$:ifk$=""then1557
1560 print"[147][206]ow try it again and see what happens"
1562 print"if you change just a few of your life- style habits."
1570 print"[196]o you want to run the program again (y/n)?"
1580 getk$:ifk$=""then1580
1590 ifk$="y"ork$="[217]"thengoto5
1600 ifk$="n"ork$="[206]"then63000
1610 goto1580
1700 :
60000 t$=" ":c=0:c$="":print"[147]":poke53281,0
60030 printspc(9)""t$:printspc(9)" [204]ife [197]xpectancy [209]uiz [146]"
60051 printspc(9)""t$:print:printtab(18)"by"
60060 print:printspc(14)"[202]ohn [207]rban"
60070 print:printspc(12)"[195]opyright 1985"
60080 print:print:print:print" [204][207][193][196][211][212][193][210] is not public domain."
60090 print:print" [208]lease respect the author's rights."
60100 print:print" [208]ress space bar to continue."
60110 forcc=1to48:getk$:ifk$=" "then60130
60120 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
60125 next:goto60100
60130 printc$:return
63000 rem connect back to l.s.
63002 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
63004 poke198,0:poke631,13:poke632,13:poke198,2:end